package $___666;

import java.util.Scanner;

public class MCCircle {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入所需画之圆的半径:");
        int radius = input.nextInt();
        result(radius);
    }//输出函数值数组
    public static void result(int radius) {
        int arr[] = new int[radius + 1];
        double temp = 0;
        int halfRadius = 0;
        if(radius % 2 == 0) {
            halfRadius = radius / 2;
        }else{
            halfRadius = radius / 2 + 1;
        }int count = 0;
        for(int j = 0; j <= halfRadius + 1; j++) {
            temp = Math.sqrt(radius * radius - j * j);
            arr[j] = siSheWuRu(temp);
            System.out.println("arr[" + j + "] = " + arr[j]);
            if(j == 0) {
                count++;
            }else if(j > 0) {
                if(arr[j-1] == arr[j]) {
                    count++;
                }else {
                    System.out.println(count);
                   count = 1;
                }
            }
        }
    }//对函数值进行四舍五入
    public static int siSheWuRu(double temp) {
        int temp0 = (int)(temp);
        int result = 0;
        if(temp - temp0 >= 0.5) {
            result = temp0 + 1;
        }else if(temp - temp0 < 0.5) {
            result = temp0;
        }return result;
    }
}